import request from '@/utils/request'

/**
 * 订货分类
 */

/**
 * 订货分类列表
 * @param {*} params 
 */
export function orderGoods(params = {}) {
  return request({
    url: '/basic/data/orderClass/list',
    method: 'get',
    params: params
  })
}

/**
 * 保存订货分类
 * @param {*} params 
 */
export function orderGoodsSave(params = {}) {
  return request({
    url: '/basic/data/orderClass/save',
    method: 'post',
    data: params
  })
}

/**
 * 修改订货分类
 * @param {*} params 
 * @returns 
 */
export function orderGoodsUpdate(params = {}) {
  return request({
    url: '/basic/data/orderClass/update',
    method: 'post',
    data: params
  })
}

/**
 * 订货分类详情
 * @param {*} params 
 */
export function orderGoodsDetail(params = {}) {
  let url = '/basic/data/orderClass/getInfo/' + params.orderClassId;
  console.log('url=', url);
  return request({
    url: url,
    method: 'get',
    // params: params
  })
}

/**
 * 行政区划 树形结构
 * @param {*} params 
 * @returns 
 */
export function getDivisionTree(params = {}) {
  // console.log('params=', params);
  return request({
    url: '/basic/data/division/tree?name=' + params.name,
    // url: '/basic/data/division/tree',
    method: 'get',
    params: params
  })
}